<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/static/admin/index/jquery.min.js"></script>
    <script src="/static/admin/index/echarts.min.js"></script>
    <script src="/static/admin/index/vue.min.js"></script>
    <script src="/static/admin/index/MagicCusJSFun.js"></script>
    <script src="/static/admin/index/HttpRequest.js"></script>
    <script src="/static/admin/index/axios.min.js"></script>
    <link rel="stylesheet" href="/static/admin/index/index.css">
    <!-- 引入组件库 -->
    <script src="/static/admin/index/index.js"></script>
    <style>

        #app {
            background-color: #F3F3F3;
            padding: 15px;
        }
        .top-item:hover p{
           color: #3369ff;
        }
        .documenDataItem:hover p{
            color: #3369ff;
        }

        .top {
            display: flex;
            justify-content: space-between;
        }

        .top .top-item {

            width: 22%;
            padding: 30px 1%;
            background-color: #ffffff;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .top .top-item img{
            width: 72px;
            height: 72px;
        }

        .top .prese {
            font-size: 28px;
        }

        .documenData {
            display: flex;

            margin:  10px auto;
        }

        .documenData .documenDataItem {
            width: 24%;
            margin-right: 1%;
            padding: 15px 0;
            text-align: left;
            justify-content: left;
            background-color: #FFFFFF;
        }

        .documenData .documenDataItem:last-child {
            margin-right: 0;
        }

        .documenData .documenDataItem .documenDataItemImg {
            display: flex;
            align-items: center;
            margin-left: 30px;
        }

        .documenData .documenDataItem .documenDataItemImg img {
            width: 20px;
            height: 20px;
            margin-right: 8px;
        }

        .documenData .documenDataItem .documenDataItemTxt {
            display: flex;
            align-items: center;
            margin-left: 30px;
            font-size: 28px;
        }

        .doucment_member {
            background-color: #ffffff;
            padding: 15px;
        }

        .doucment_member .tt {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .doucment_member .doucment_member_list {
            display: flex;
            flex-wrap: wrap;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item {
            width: 23%;
            padding: 5px 2%;
            padding-left: 0;
            display: flex;
            position: relative;
            justify-content: space-between;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item::before {
            content: "";
            position: absolute;
            width: 1px;
            background-color: #DDDDDD;
            top: 5%;
            height: 80%;
            right: 2%;

        }

        .doucment_member .doucment_member_list .doucment_member_list_item .left_tt {

            text-align: left;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .left_tt div {
            font-size: 14px;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .left_tt p {
            font-size: 18px;
            font-weight: 700;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .right_tt {

            text-align: right;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .right_tt div {
            font-size: 14px;
            color: rgba(0, 0, 0, 0.4);
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .right_tt p {
            font-size: 14px;
            color: #D54941;
        }

        .fee {
            padding: 15px 0;
            display: flex;
            justify-content: space-between;
        }
        .businessbar{
            padding: 15px 1%;
            display: flex;
            justify-content: space-between;

            width: 95%;
            height: 450px;
            background-color: #fff;
        }
        #businessbar{
            width: 90%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .feeCount {
            width: 30%;
            height: 450px;
            background-color: #fff;
        }

        .fee #feeCount {
            width: 95%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .feeOrderCount {
            width: 68%;
            height: 450px;
            background-color: #fff;
        }

        .fee #feeOrderCount {
            width: 95%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .tts {
            font-size: 20px;
            font-weight: 700;
            padding: 15px;
        }
        .tts {
            font-size: 20px;
            font-weight: 700;
            padding: 15px;
        }
        .top p,.documenDataItemImg p{
            font-size: 20px;
            font-weight: 700;
        }

        .good_member {
            padding: 15px 0;
            display: flex;
        }

        .good_member .good_member_item {
            width: 30%;
            background-color: #fff;
            padding: 1%;
        }

        .good_member .good_member_item:nth-child(2) {
            margin: 0 2%;
        }

        .good_member .good_member_item .tt {
            font-size: 20px;
            font-weight: 700;
        }

        .good_member .good_member_item .good_member_top {
            display: flex;
            width: 100%;
            height: 92px;
            border: 1px solid #DDDDDD;
            margin-top: 20px;
        }

        .good_member .good_member_item .good_member_top .good_member_top_item {

            width: 50%;

            text-align: center;

            padding-top: 18px;

            position: relative;
        }

        .good_member .good_member_item .good_member_top .good_member_top_item:nth-child(1):before {
            content: "";
            width: 1px;
            height: 50%;
            background-color: #DDDDDD;
            position: absolute;
            top: 25%;
            right: 0;

        }

        .good_member .good_member_item .good_member_top .good_member_top_item .tts {
            font-size: 14px;
            color: #999999;
        }

        .good_member .good_member_item .good_member_top .good_member_top_item p {
            font-size: 18px;
        }

        .good_member .good_member_item .good_member_list_header {
            display: flex;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item {
            color: rgba(0, 0, 0, 0.4);
            font-size: 14px;
            line-height: 60px;
            text-align: center;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item:nth-child(1) {
            width: 10%;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item:nth-child(2) {
            width: 70%;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item:nth-child(3) {
            width: 20%;
        }


        .good_member .good_member_item .good_member_list {

        }

        .good_member .good_member_item .good_member_list {
            color: rgba(0, 0, 0, 0.4);
            font-size: 14px;
            line-height: 60px;
            display: flex;
            align-items: center;
            text-align: center;
            justify-content: center;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(1) {
            width: 10%;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(1) .yuan {
            width: 24px;
            height: 24px;
            background: #0052D9;
            opacity: 1;
            color: #fff;
            line-height: 24px;
            font-size: 14px;
            border-radius: 50%;
            margin: 0 auto;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(2) {
            width: 70%;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(3) {
            width: 20%;
        }

        .nopic {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        a { text-decoration: none; color: inherit; }
    </style>
    <script src="/static/admin/index/echarts.min.js"></script>

</head>
<body>
<div id="app">
    <div class="nopic" v-if="isXs">
        <img src="/static/admin/index/ncs.png" alt="">
    </div>
    <div v-else>
        <div class="top">
            {if $userInfo['roleid']==1}
            <div class="top-item" >
                <div class="top-item-left">
                    <a href='{:url("/admin/business.business?status=0")}'>
                        <p>待审核服务站</p>
                        <div class="prese">
                            {{topBusinessStatus}}
                        </div>
                    </a>
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/yzcyh.png" alt="">
                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <p>累计访客 <i class="el-icon-warning-outline"></i></p>-->
                    <a href='{:url("/admin/business.business?status=1")}'>
                        <p>入驻服务站</p>
                        <div class="prese">
                            {{topBusinessNum}}
                        </div>
                    </a>
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/ljfk.png" alt="">
                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <p>已注册用户 <i class="el-icon-warning-outline"></i></p>-->
                    <a href='{:url("/admin/member2.member/index")}'>
                    <p>会员</p>

                    <div class="prese">
                        {{topMember}}
                    </div>
                    </a>
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/all-application.png" alt="">
                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <p>已注册用户 <i class="el-icon-warning-outline"></i></p>-->

                    <a href='{:url("/admin/member2.order/index")}'>
                        <p>会员订单量</p>
                        <div class="prese">
                            {{memberOrderNum}}
                        </div>
                    </a>
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/view-list.png" alt="">
                </div>
            </div>
            {else}
            <div class="top-item" >
                <div class="top-item-left">

                        <p>待审核服务站</p>
                        <div class="prese">
                            {{topBusinessStatus}}
                        </div>

                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/yzcyh.png" alt="">
                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <p>累计访客 <i class="el-icon-warning-outline"></i></p>-->
                        <p>入驻服务站</p>
                        <div class="prese">
                            {{topBusinessNum}}
                        </div>

                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/ljfk.png" alt="">
                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <p>已注册用户 <i class="el-icon-warning-outline"></i></p>-->
                    <a>
                        <p>会员</p>

                        <div class="prese">
                            {{topMember}}
                        </div>
                    </a>
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/all-application.png" alt="">
                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <p>已注册用户 <i class="el-icon-warning-outline"></i></p>-->

                    <a>
                        <p>会员订单量</p>
                        <div class="prese">
                            {{memberOrderNum}}
                        </div>
                    </a>
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/view-list.png" alt="">
                </div>
            </div>
            {/if}
        </div>

        <div class="documenData">

            <div class="documenDataItem">
                <a href='{:url("/admin/business.businessorder?status=1")}'>
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/wdzjps.png" alt="">
                    <p>服务站订单待发货：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.data1}}
<!--                    {{documentCont.doucmentCount}}篇-->
                </div>
                </a>
            </div>

            <div class="documenDataItem">
                <a href='{:url("/admin/business.businessorder?status=3")}'>
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/ptwd.png" alt="">
                    <p>服务站订单配送中：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.data2}}
                </div>
                </a>
            </div>

            <div class="documenDataItem">
                <a href='{:url("/admin/business.businessorder?status=2")}'>
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/yzwd.png" alt="">
                    <p>服务站订单已完成：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.data3}}
                </div>
                </a>
            </div>
            <div class="documenDataItem">
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/jpwd.png" alt="">
                    <p>服务站订单总金额：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.data4}}
                </div>
            </div>
            <div class="documenDataItem">
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/wdhyrs.png" alt="">
                    <p>服务站订单昨日金额：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.data5}}
                </div>
            </div>
        </div>
<!--        <div class="doucment_member">-->
<!--            <div class="tt">文档会员统计</div>-->
<!--            <div class="doucment_member_list">-->
<!--                <div class="doucment_member_list_item" v-for="(item,index) in documentGroup">-->
<!--                    <div class="left_tt">-->
<!--                        <div>{{item.title}}</div>-->
<!--                        <p>{{item.count}}人</p>-->
<!--                    </div>-->
<!--                    <div class="right_tt">-->
<!--                        <div>{{item.price}}</div>-->
<!--                        <p>{{item.price * item.count}}</p>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
        <div class="fee">
            <div class="feeCount">
                <div class="tts">服务站订货类型</div>
                <div id="feeCount">

                </div>
            </div>
            <div class="feeOrderCount">
                <div class="tts">近7日服务站订单金额</div>
                <div id="feeOrderCount">

                </div>
            </div>
        </div>
        <div class="businessbar">
            <div class="tts">服务站订单量</div>
            <div id="businessbar">

            </div>
        </div>
<!--        <div class="good_member">-->
<!--            <div class="good_member_item">-->
<!--                <div class="tt">DIY卖家数据统计</div>-->
<!--                <div class="good_member_top">-->
<!--                    <div class="good_member_top_item">-->
<!--                        <div class="tts">卖家人数统计</div>-->
<!--                        <p>{{diy.memberCount}}人</p>-->
<!--                    </div>-->
<!--                    <div class="good_member_top_item">-->
<!--                        <div class="tts">产品总数量</div>-->
<!--                        <p>{{diy.GoodsCount}}人</p>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="good_member_list_header">-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        序号-->
<!--                    </div>-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        卖家名称-->
<!--                    </div>-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        产品数量-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="good_member_list" v-for="(item,index) in diy.goods" v-if="diy.goods.length > 0" v-if="index < 6">-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="yuan">{{index + 1}}</div>-->
<!--                    </div>-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="tit">{{item.nickname}}</div>-->
<!--                    </div>-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="num">{{item.meberGoodsCount}}</div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="good_member_item">-->
<!--                <div class="tt">百货卖家数据统计</div>-->
<!--                <div class="good_member_top">-->
<!--                    <div class="good_member_top_item">-->
<!--                        <div class="tts">卖家人数统计</div>-->
<!--                        <p>{{bh.memberCount}}人</p>-->
<!--                    </div>-->
<!--                    <div class="good_member_top_item">-->
<!--                        <div class="tts">产品总数量</div>-->
<!--                        <p>{{bh.GoodsCount}}人</p>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="good_member_list_header">-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        序号-->
<!--                    </div>-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        卖家名称-->
<!--                    </div>-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        产品数量-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="good_member_list" v-for="(item,index) in bh.goods" v-if="bh.goods.length > 0" v-if="index < 6">-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="yuan">{{index + 1}}</div>-->
<!--                    </div>-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="tit">{{item.nickname}}</div>-->
<!--                    </div>-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="num">{{item.meberGoodsCount}}</div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="good_member_item">-->
<!--                <div class="tt">二手卖家数据统计</div>-->
<!--                <div class="good_member_top">-->
<!--                    <div class="good_member_top_item">-->
<!--                        <div class="tts">卖家人数统计</div>-->
<!--                        <p>{{es.memberCount}}人</p>-->
<!--                    </div>-->
<!--                    <div class="good_member_top_item">-->
<!--                        <div class="tts">产品总数量</div>-->
<!--                        <p>{{es.GoodsCount}}人</p>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="good_member_list_header">-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        序号-->
<!--                    </div>-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        卖家名称-->
<!--                    </div>-->
<!--                    <div class="good_member_list_header_item">-->
<!--                        产品数量-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="good_member_list" v-for="(item,index) in es.goods" v-if="es.goods.length > 0" v-if="index < 6">-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="yuan">{{index + 1}}</div>-->
<!--                    </div>-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="tit">{{item.nickname}}</div>-->
<!--                    </div>-->
<!--                    <div class="good_member_list_item">-->
<!--                        <div class="num">{{item.meberGoodsCount}}</div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->


<!--        </div>-->
    </div>
</div>
<script>
    var app = new Vue({
        data() {
            return {
                name: 111,
                isXs: false,
                topCont: {},
                documentCont: {},
                documentGroup: [],
                diy:{},
                bh:{},
                es:{},

                memberOrderNum:0,
                topBusinessNum:0,
                topBusinessStatus:0,
                topMember:0,
                z_data:{},
                pieData:[],
            }
        },
        mounted() {
            this.GetDate()
            this.getpie()
        },
        methods: {
            GetDate(){
                axios.get('{:url('/index1')}').then(response => {
                    $data=response.data;
                    this.topBusinessNum = $data.data;
                })
                    .catch(error => {
                        console.error('There was an error!', error);
                    });
                axios.get('{:url('/index2')}').then(response => {
                    $data=response.data;
                    this.topBusinessStatus = $data.data;
                })
                    .catch(error => {
                        console.error('There was an error!', error);
                    });
                axios.get('{:url('/index3')}').then(response => {
                    $data=response.data;
                    this.topMember = $data.data;
                })
                    .catch(error => {
                        console.error('There was an error!', error);
                    });
                axios.get('{:url('/index4')}').then(response => {
                    $data=response.data;
                    this.z_data = $data.data;
                })
                    .catch(error => {
                        console.error('There was an error!', error);
                    });
                axios.get('{:url('/orderNum')}').then(response => {
                    $data=response.data;
                    this.memberOrderNum = $data.data;
                })
                    .catch(error => {
                        console.error('There was an error!', error);
                    });
            },
            getpie(){
                    var chartDom = document.getElementById('feeCount');
                    var myChart = echarts.init(chartDom);
                    var option;
                    axios.get('{:url('/pieCate')}').then(response => {
                        $data=response.data;
                    var datas=$data.data;
                        this.pieData = $data.data;
                    // console.log($data);
                    // console.log(this.pieData[1]['name']);

                    // var datas = [
                    //     {
                    //         value: 335,
                    //         name: '11112'
                    //     },
                    //     {
                    //         value: 234,
                    //         name: '联盟广告111'
                    //     },
                    //     {
                    //         value: 158,
                    //         name: '搜索引擎222'
                    //     },
                    //     {
                    //         value: 20,
                    //         name: '其它'
                    //     }
                    // ];
                    option = {
                        title: {
                            left: 'center',
                            textStyle: {
                                color: '#999',
                                fontWeight: 'normal',
                                fontSize: 14
                            }
                        },
                        series: [
                            {
                                type: 'pie',
                                data:datas
                            }
                        ]
                    };
                    option && myChart.setOption(option);
                    })
                        .catch(error => {
                            console.error('There was an error!', error);
                        });
            },
        }
    })

    app.$mount('#app');



    function FeeOrderCount() {
        var chartDom = document.getElementById('feeOrderCount');
        var myChart = echarts.init(chartDom);
        var option;
        axios.get('{:url('/barData')}').then(response => {
            $data=response.data;
            option = {
                xAxis: {
                    type: 'category',
                    boundaryGap: true,
                    data:  $data.data['date']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data:  $data.data['price'],
                        type: 'bar',
                        smooth: true
                    }
                ]
            };

            option && myChart.setOption(option);
        })
            .catch(error => {
                console.error('There was an error!', error);
            });
    }
    FeeOrderCount();

    function FeeOrderCount2() {
        var chartDom = document.getElementById('businessbar');
        var myChart = echarts.init(chartDom);
        var option;
        axios.get('{:url('/IndexBusinessOrder')}').then(response => {
            $data=response.data;
            option = {
                xAxis: {
                    type: 'category',
                    boundaryGap: true,
                    data:  $data.data['business_name']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data:  $data.data['order_num'],
                        type: 'bar',
                        smooth: true,
                        color:[
                            '#f6c20c'
                        ]
                    }
                ]
            };

            option && myChart.setOption(option);
        })
            .catch(error => {
                console.error('There was an error!', error);
            });
    }
    FeeOrderCount2();
</script>
</body>
</html>
